package com.joe.demo.nio.io;

import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.SocketChannel;
import java.nio.charset.StandardCharsets;

/**
 * @Description
 * @Author gaojw
 * @Date 2024-08-28
 */
@Slf4j
public class MultiThreadClient {

    public static void main(String[] args) throws IOException {
        final SocketChannel client = SocketChannel.open();
        client.connect(new InetSocketAddress("localhost", 8080));
        client.write(StandardCharsets.UTF_8.encode("hello joe"));
        System.in.read();


    }
}
